
package com.uam.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uam.db.mapper.DataLayerBcMapper;
import com.uam.db.mapper.DataLayerMapper;
import com.uam.db.model.entity.DataLayer;
import com.uam.db.model.entity.DataLayerBc;
import com.uam.service.IDataLayerBcService;
import com.uam.service.IDataLayerService;
import com.uam.utils.Convert;
import com.uam.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 图层记录Service业务层处理
 *
 * @author uam
 * @date 2023-11-23
 */
@Service
public class DataLayerBcServiceImpl implements IDataLayerBcService {
    @Autowired
    private DataLayerBcMapper dataLayerBcMapper;

    /**
     * 查询图层记录
     *
     * @param id 图层记录主键
     * @return 图层记录
     */
    @Override
    public DataLayerBc selectDataLayerById(Long id) {
        return dataLayerBcMapper.selectDataLayerById(id);
    }

    /**
     * 查询图层记录列表
     *
     * @param dataLayer 图层记录
     * @return 图层记录
     */
    @Override
    public IPage<DataLayerBc> selectDataLayerList(Page<DataLayerBc> page, DataLayerBc dataLayer) {
        return dataLayerBcMapper.selectDataLayerList(page, dataLayer);
    }

    /**
     * 新增图层记录
     *
     * @param dataLayer 图层记录
     * @return 结果
     */
    @Override
    public int insertDataLayer(DataLayerBc dataLayer) {
        dataLayer.setCreateTime(DateUtils.getNowDate());
        return dataLayerBcMapper.insertDataLayer(dataLayer);
    }

    /**
     * 修改图层记录
     *
     * @param dataLayer 图层记录
     * @return 结果
     */
    @Override
    public int updateDataLayer(DataLayerBc dataLayer) {
        dataLayer.setUpdateTime(DateUtils.getNowDate());
        return dataLayerBcMapper.updateDataLayer(dataLayer);
    }

    /**
     * 批量删除图层记录
     *
     * @param ids 需要删除的图层记录主键
     * @return 结果
     */
    @Override
    public int deleteDataLayerByIds(String ids) {
        return dataLayerBcMapper.deleteDataLayerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除图层记录信息
     *
     * @param id 图层记录主键
     * @return 结果
     */
    @Override
    public int deleteDataLayerById(Long id) {
        return dataLayerBcMapper.deleteDataLayerById(id);
    }
}
